package com.G_CN06.commonUtil;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.springframework.stereotype.Component;

/**
 * @author hcx
 * @className CacheGuava
 * @description 本地缓存的使用
 * @date 2023/2/9 16:35
 **/
@Component
public class CacheGuava {

    private Cache<String,Object> userInfoCache = CacheBuilder.newBuilder()
            .maximumSize(20)
            .concurrencyLevel(3)
            .initialCapacity(10)
            .build();

    public Cache<String,Object> getUserInfoCache(){
        return this.userInfoCache;
    }

    private void  setUserInfoCache(Cache<String,Object> userInfoCache){
        this.userInfoCache = userInfoCache;
    }
}
